var Koa=require("koa");
var router=require("koa-router")();
var session=require("koa-session");
var app=new Koa();
app.listen("3001",()=>{
    console.log("成功");
})
app.keys=['fkjsklaf']
app.use(session({maxAge:20*1000},app));
router.get("/",async ctx=>{
    ctx.session.admin="123147";
    ctx.body='session'
})
router.get("/session",async ctx=>{
    var admin=ctx.session.admin;
    ctx.body='12'+admin;
})
app.use(router.routes())
app.keys=['asfas'];
app.use(session({maxAge:1000},app))


